/*    */ package com.newcrm.webapi.sub;
/*    */ 
/*    */ import com.newcrm.bean.User;
/*    */ import com.newcrm.db.UserManager;
/*    */ import com.newcrm.exception.NotFoundException;
/*    */ import com.newcrm.util.Util;
/*    */ import com.newcrm.webapi.AbstractAction;
/*    */ import com.newcrm.webapi.AbstractHttpServlet;
/*    */ import java.io.IOException;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import org.apache.log4j.Logger;
/*    */ 
/*    */ public class UpdateAppUser extends AbstractAction
/*    */ {
/* 21 */   private static Logger logger = Logger.getLogger(UpdateAppUser.class
/* 22 */     .getName());
/*    */ 
/*    */   public UpdateAppUser(AbstractHttpServlet servlet)
/*    */   {
/* 25 */     super(servlet);
/*    */   }
/*    */ 
/*    */   public void parse(HttpServletRequest request, HttpServletResponse response)
/*    */     throws IOException, ServletException, NotFoundException
/*    */   {
/* 31 */     User loginUser = super.getLoginUser(request);
/*    */ 
/* 33 */     String name = Util.getURLParameter(request.getParameter("name"));
/* 34 */     int sex = Util.getURLIntParameter(request.getParameter("sex"));
/* 35 */     String idCard = Util.getURLParameter(request.getParameter("idCard"));
/* 36 */     String mobile = Util.getURLParameter(request.getParameter("mobile"));
/* 37 */     String qq = Util.getURLParameter(request.getParameter("qq"));
/* 38 */     String email = Util.getURLParameter(request.getParameter("email"));
/*    */ 
/* 40 */     UserManager manager = new UserManager();
/*    */     try
/*    */     {
/* 43 */       int result = manager.update(loginUser.userId, name, sex, idCard, 
/* 44 */         mobile, qq, email, null, null);
/* 45 */       if (result <= 0) {
/* 46 */         super.showErrorMessage(response, "用户信息更新失败，请稍后再试");
/* 47 */         return;
/*    */       }
/* 49 */       super.showSuccessMessage(response);
/*    */     } catch (Exception e) {
/* 51 */       logger.warn("update user info failed", e);
/* 52 */       super.showErrorMessage(response, "用户信息更新失败，请稍后再试");
/* 53 */       return;
/*    */     }
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.sub.UpdateAppUser
 * JD-Core Version:    0.6.1
 */